import request from '@/router/axios';

// 获取列表
export const getList = (current, size, params) => {
  return request({
    url: '/api/hg-public/relation/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

// 关联设备
export const save = (data,oriEptCode) => {
  return request({
    url: '/api/hg-public/relation/save',
    method: 'post',
    data: data,
    params: {
      oriEptCode
    }
  })
}
// 删除关联设备
export const deleteEquipment = (eptCode) => {
  return request({
    url: '/api/hg-public/relation/delete',
    method: 'post',
    params: {
      eptCode
    }
  })
}

// 详情
export const detail = (current, size, params) => {
  return request({
    url: '/api/hg-public/relation/info/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

// 获取已关联的设备
export const relationList = (oriEptCode) => {
  return request({
    url: '/api/hg-public/relation/relationList',
    method: 'post',
    params: {
      oriEptCode
    }
  })
}

// 批量更新使用数量
export const updateNum = (data) => {
  return request({
    url: '/api/hg-public/relation/update/num',
    method: 'post',
    data
  })
}